>> TGS_phase_analysis('Cr_single_crystal-2019-06-27-06.40um-85degrees-POS-1.txt','Cr_single_crystal-2019-06-27-06.40um-85degrees-NEG-1.txt',6.4,1)

f2 = 

     General model:
     f2(x) = A.*(erfc(q*sqrt(k*(x+start_time)))-beta*exp(-q^2*k*(x+start_time)
                    )./sqrt((x+start_time)))+B.*sin(2*pi*(peak_freq)*(x+
                    start_time)+p)*exp(-(x+start_time)/t)+D
     Coefficients (with 95% confidence bounds):
       A =     0.01916  (0.01901, 0.01931)
       k =   2.794e-05  (2.754e-05, 2.834e-05)
       beta =   3.663e-11  (fixed at bound)
       B =    0.008214  (0.008096, 0.008332)
       p =      -2.111  (-2.122, -2.1)
       t =   2.475e-08  (2.421e-08, 2.528e-08)
       D =   7.348e-05  (4.926e-05, 9.769e-05)
     Problem parameters:
       q =   9.817e+05
       start_time =       7e-10
       peak_freq =   5.516e+08
Bad fit for:Cr_single_crystal-2019-06-27-06.40um-85degrees-POS-1.txt~re: beta

ans =

   5.5163e+08